<template>
    <div class="show mt15">
        <div class="new-total">
            <slot name='other'></slot>
        </div>
        <div class="block tc mb10">
            <el-pagination @current-change="handleChange" :current-page.sync="newPage" :page-size="pageSize" layout="total, prev, pager, next,jumper" :total="total">
            </el-pagination>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            newPage: 1
        }
    },
    props: {
        page: {
            type: Number,
            default: 1
        },
        pageSize: {
            type: Number,
            default: 15
        },
        total: {
            type: Number,
            default: 0
        }
    },
    watch: {
        page: {
            handler(newP) {
                // console.log(old,ne)
                this.newPage = newP
            }
        }
    },
    methods: {
        handleChange(page) {
            this.$emit('pageFun', page)
        }
    }
}
</script>

<style scoped>
.show {
  display: flex;
  justify-content: center;
  align-items: center;
}
.new-total {
  margin-top: -10px;
}
</style>